const React = require('react');
const {View, StyleSheet, TouchableHighlight} = require('react-native');
const {
    JDDevice,
    JDText,
    JDRouter,
    JDTouchable,
    JDButton,
} = require('@areslabs/jdreact-core-lib');
const {NavigationBar} = JDRouter;

var i = 1;

class JDbuttonExample extends React.Component {
    render() {
        return (
            <View style={styles.wrapper}>
                <NavigationBar Title="JDbutton组件"/>
                <View style={styles.content}>
                    <JDText>
                        跨平台通用的按钮的组件
                    </JDText>
                    <View style={styles.touchContainer}>
                        <JDButton  onPress={()=>{

                            i++;
                            alert('You pressed me'+i)
                        }} style={styles.btn}>
                            <JDText> Touch Here </JDText>
                        </JDButton>
                    </View>
                </View>


            </View>
        );
    }
}

const styles = StyleSheet.create({
    wrapper: {
        flex: 1,

    },
    content: {
        paddingTop: 10,
        paddingLeft: 10,
        paddingRight: 10,
    },
    touchContainer:{
        height:300,
        justifyContent:'center',
        alignItems:'center',
    },
    btn: {
        width: 200,
        height: 40,
        // backgroundColor: 'blue'

    }

});

module.exports = JDbuttonExample;
